package material.wrapper;

public class StarBuckCoffee {
    public static void main(String[] args) {
        Beverage beverage = new Espresso();
        System.out.println(beverage.getDescription() + "$" + beverage.cost());
        //用黑咖啡为原料添加--摩卡，奶泡做出一个新的饮料
        Beverage beverage2 = new DarkRoast();//原料--黑咖啡
        beverage2 = new Mocha(beverage2);//添加摩卡
        beverage2 = new Mocha(beverage2);//用第二个摩卡装饰它
        beverage2 = new Whip(beverage2);//添加奶泡
        System.out.println(beverage2.getDescription()
                + " $" + String.format("%.2f", beverage2.cost()));
        //调料为豆浆，摩卡，奶泡
        Beverage beverage3 = new HouseBlend();//原料
        beverage3 = new Soy(beverage3);
        beverage3 = new Mocha(beverage3);
        beverage3 = new Whip(beverage3);
        System.out.println(beverage3.getDescription()
                + " $" + String.format("%.2f", beverage3.cost()));
        //和上面同样的配方，但是我们将杯子的大小改成中杯（默认是小杯）
        Beverage beverage3_1 = new HouseBlend();//原料
        beverage3_1.size = Beverage.Size.GRANDE;
        beverage3_1 = new Soy(beverage3_1);
        beverage3_1 = new Mocha(beverage3_1);
        beverage3_1 = new Whip(beverage3_1);
        System.out.print("将杯子大小改为GRANDE--中杯之后：");
        System.out.println(beverage3_1.getDescription()
                + " $" + String.format("%.2f", beverage3_1.cost()));

    }
}
